The present invention relates to a computer, a method of controlling the computer, and a recording medium into which the method of controlling is recorded.
Generally speaking, for computers, single-processor single-task systems for executing a single job (user program) with a single processing device, single-processor multitask systems for executing a plurality of jobs with a single processor, and, multiprocessor multitask systems for executing a plurality of jobs with a plurality of processing devices are known.
Among these, the multiprocessor system has a plurality of processors which process the plurality of jobs in parallel and independently.
On one hand, in the single-processor multitask system, usually, the plurality of jobs (user programs) are seemingly executed simultaneously.
However, problems such as a race condition concerning monopolization of computer resources may occur because there are a plurality of jobs to be processed although there is only a single processor.
In the computer described above, a plurality of user programs are processed in a time-sharing manner while avoiding the race condition under the control of an OS (Operating System), which is a basic software.
In the single processor system described above, a dedicated instruction for efficiently and safely executing exclusive control at the user process level may be provided in some cases. However, there are many cases where such dedicated instructions are not provided, depending on the kind of processor. In such cases, there is no means for efficiently and safely executing exclusive control at the user process level.